package com.kt.ktplayer.model

import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName

@TableName(value ="t_user")
open class TUserEntity {
    @TableId
    var id: String? = null
    var name: String? = null
    var loginName: String? = null
    var age: Int? = null
    var address: String? = null
    var gender: Int? = null
    var email: String? = null
    var abbreviation: String? = null
    var birthDay: java.sql.Date? = null
    var fax: String? = null
    var picUrl: Any? = null
    var comments: Any? = null
    var tenantId: String? = null
    var status: Int? = null
    var approvalStatus: Int? = null
    var createTime: java.sql.Timestamp? = null
    var modifyTime: java.sql.Timestamp? = null
    var createUser: String? = null
    var modifyUser: String? = null
    var mobile: String? = null
    var telephone: String? = null
    var showOrder: Long? = null
    var beginValidTime: java.sql.Date? = null
    var endValidTime: java.sql.Date? = null
    var identityId: String? = null
    var isSuperadmin: Int? = null
    var unitId: String? = null
    var flag1: String? = null
    var flag2: String? = null
    var flag3: String? = null
    var flag4: String? = null
    var flag5: String? = null
    var flag6: String? = null
    var flag7: String? = null
    var flag8: String? = null
    var flag9: String? = null
    var flag10: String? = null
    var bindAddressType: Int? = null
    var bindIpAddress: String? = null
    var bindMacAddress: String? = null


    override fun toString(): String =
            "Entity of type: ${javaClass.name} ( " +
                    "id = $id " +
                    "name = $name " +
                    "loginName = $loginName " +
                    "age = $age " +
                    "address = $address " +
                    "gender = $gender " +
                    "email = $email " +
                    "abbreviation = $abbreviation " +
                    "birthDay = $birthDay " +
                    "fax = $fax " +
                    "picUrl = $picUrl " +
                    "comments = $comments " +
                    "tenantId = $tenantId " +
                    "status = $status " +
                    "approvalStatus = $approvalStatus " +
                    "createTime = $createTime " +
                    "modifyTime = $modifyTime " +
                    "createUser = $createUser " +
                    "modifyUser = $modifyUser " +
                    "mobile = $mobile " +
                    "telephone = $telephone " +
                    "showOrder = $showOrder " +
                    "beginValidTime = $beginValidTime " +
                    "endValidTime = $endValidTime " +
                    "identityId = $identityId " +
                    "isSuperadmin = $isSuperadmin " +
                    "unitId = $unitId " +
                    "flag1 = $flag1 " +
                    "flag2 = $flag2 " +
                    "flag3 = $flag3 " +
                    "flag4 = $flag4 " +
                    "flag5 = $flag5 " +
                    "flag6 = $flag6 " +
                    "flag7 = $flag7 " +
                    "flag8 = $flag8 " +
                    "flag9 = $flag9 " +
                    "flag10 = $flag10 " +
                    "bindAddressType = $bindAddressType " +
                    "bindIpAddress = $bindIpAddress " +
                    "bindMacAddress = $bindMacAddress " +
                    ")"

    // constant value returned to avoid entity inequality to itself before and after it's update/merge
    override fun hashCode(): Int = 42

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false
        other as TUserEntity

        if (id != other.id) return false
        if (name != other.name) return false
        if (loginName != other.loginName) return false
        if (age != other.age) return false
        if (address != other.address) return false
        if (gender != other.gender) return false
        if (email != other.email) return false
        if (abbreviation != other.abbreviation) return false
        if (birthDay != other.birthDay) return false
        if (fax != other.fax) return false
        if (picUrl != other.picUrl) return false
        if (comments != other.comments) return false
        if (tenantId != other.tenantId) return false
        if (status != other.status) return false
        if (approvalStatus != other.approvalStatus) return false
        if (createTime != other.createTime) return false
        if (modifyTime != other.modifyTime) return false
        if (createUser != other.createUser) return false
        if (modifyUser != other.modifyUser) return false
        if (mobile != other.mobile) return false
        if (telephone != other.telephone) return false
        if (showOrder != other.showOrder) return false
        if (beginValidTime != other.beginValidTime) return false
        if (endValidTime != other.endValidTime) return false
        if (identityId != other.identityId) return false
        if (isSuperadmin != other.isSuperadmin) return false
        if (unitId != other.unitId) return false
        if (flag1 != other.flag1) return false
        if (flag2 != other.flag2) return false
        if (flag3 != other.flag3) return false
        if (flag4 != other.flag4) return false
        if (flag5 != other.flag5) return false
        if (flag6 != other.flag6) return false
        if (flag7 != other.flag7) return false
        if (flag8 != other.flag8) return false
        if (flag9 != other.flag9) return false
        if (flag10 != other.flag10) return false
        if (bindAddressType != other.bindAddressType) return false
        if (bindIpAddress != other.bindIpAddress) return false
        if (bindMacAddress != other.bindMacAddress) return false

        return true
    }

}

